/*
 *
 * extensions of standard menu style definitions, see master style sheet for more menu related styles.
 *
 */

/* top level menu */
ul#menu-bar {
    behavior:menu-bar;
    flow: horizontal;
    margin: 0;

    font: system;
    font-rendering-mode: classic;
    color: windowtext;
}

/* menu item in menu bar */
ul#menu-bar > li {
    padding: 2dip 8dip;
    margin: 0;
    white-space: nowrap;
    width: max-intrinsic;
    display: block;
    flow: horizontal;
}

/* current menu item in menu bar */
ul#menu-bar > li:current {
    background-color: highlight;
    color: highlighttext;
}

button[type="menu"] {
    behavior: button popup-menu;
}

/* button when popup is shown */
button[type="menu"]:owns-popup {
	background-image: url(theme:button-pressed); /* ?? */
}

/* popup menu */
menu {
    behavior: menu; /* is a menu */
    flow: vertical;
    display: none;

    margin: 0 1dip; /* to offset it from parent li */
    max-width: max-intrinsic;
    /*min-width: max-intrinsic;*/

    border: 1dip solid threedshadow;
    padding: 1dip;

    font: system;
    font-rendering-mode: classic;

    background-color: window;
    color: windowtext;
}

/* secondary popup menu */
menu menu {
    max-width: max-intrinsic;
}

/* menu item in popup menus */
menu li {
    flow: horizontal;
    width: *;

    padding-left: 24dip; /* room for icon */
    padding-right: 12dip; /* room for the arrow */
    padding-top: 4dip;
    padding-bottom: 4dip;

    foreground-repeat: no-repeat;
    foreground-position: 2dip 50%;
    color: windowtext;
}

menu li:rtl {
    width: *;
    padding-right: 24dip; /* room for icon */
    padding-left: 12dip; /* room for the arrow */

    foreground-repeat: no-repeat;
    foreground-position-right: 2dip;
    foreground-position-top: 50%;
    text-align: right;
    color: windowtext;
}

menu li:disabled {
    color: graytext;
    foreground-image: none;
}

/* accesskey label (span) */
menu li span.accesskey {
    display: block;
    width: max-intrinsic;
    white-space: nowrap;
    margin-left: *; /* spring to attach it to the right */
    padding-left: 1em;
    color: threedshadow;
}

menu li:current span.accesskey {
    color: #FFD700;
}

/* menu with single <menu> inside - submenu */
menu li:has-child-of-type(menu) {
    foreground-image: url(stock:arrow-right); /* that arrow */
    foreground-repeat: no-repeat;
    foreground-position: 100% 50%;
}

menu li:has-child-of-type(menu):rtl {
    foreground-image: url(stock:arrow-left); /* that arrow */
    foreground-repeat: no-repeat;
    foreground-position: 0% 50%;
}

/* current menu item */
menu li:hover:owns-popup,
menu li:current {
    //background-color: highlight;
    //color: highlighttext;
    //border-radius: 3dip;
    background: url(theme:list-view-item-selected) stretch;
}

/* menu separator */
menu hr {
    margin: 2dip;
}

/* radio menu item */
menu li[type="radio"] {
	behavior: radio;
	foreground-repeat: no-repeat;
	foreground-position: 3dip 50%;
	foreground-image: url(theme:radio-normal);
}

menu li[type="radio"]:hover {
	foreground-image: url(theme:radio-hover);
}

menu li[type="radio"]:active {
	foreground-image: url(theme:radio-pressed);
}

menu li[type="radio"]:disabled {
	foreground-image: url(theme:radio-disabled);
}

menu li[type="radio"]:checked {
	foreground-image: url(theme:radio-checked-normal);
}

menu > li[type="radio"]:checked:hover {
	foreground-image: url(theme:radio-checked-hover);
}

menu li[type="radio"]:checked:active {
	foreground-image: url(theme:radio-checked-pressed);
}

menu li[type="radio"]:checked:disabled {
	foreground-image: url(theme:radio-checked-disabled);
}

/* checkmark menu item */
menu li[type="check"] {
	behavior: check;
	foreground-repeat: no-repeat;
	foreground-position: 3dip 50%;
	foreground-image: url(theme:check-normal);
}

menu li[type="check"]:hover {
	foreground-image: url(theme:check-hover);
}

menu li[type="check"]:active {
	foreground-image: url(theme:check-pressed);
}

menu li[type="check"]:disabled {
	foreground-image: url(theme:check-disabled);
}

menu li[type="check"]:checked {
	foreground-image: url(theme:check-checked-normal);
}

menu li[type="check"]:checked:hover {
	foreground-image: url(theme:check-checked-hover);
}

menu li[type="check"]:checked:active {
	foreground-image: url(theme:check-checked-pressed);
}

menu li[type="check"]:checked:disabled {
	foreground-image: url(theme:check-checked-disabled);
}
